package org.yray.neo4j.hanlp;

import com.hankcs.hanlp.HanLP;
import com.hankcs.hanlp.restful.HanLPClient;
import com.hankcs.hanlp.seg.Segment;
import com.hankcs.hanlp.seg.common.Term;

import java.io.IOException;
import java.util.List;
import java.util.Map;

public class NlpDemo {
    public static void main(String[] args) throws IOException {


        //目前分词器基本上都默认开启了中国人名识别，比如HanLP.segment()接口中使用的分词器等等，用户不必手动开启；上面的代码只是为了强调。
        String[] testCase = new String[]{
                "foxmail、outlook邮箱如何配置",
                "王国强、高峰、汪洋、张朝阳光着头、韩寒、小四",
                "张浩和胡健康复员回家了",
                "王总和小丽结婚了",
                "编剧邵钧林和稽道青说",
                "这里有关天培的有关事迹",
                "龚学平等领导,邓颖超生前,腾讯有限公司在深圳",
        };
        Segment segment = HanLP.newSegment().enableNameRecognize(true);
        segment.enableOrganizationRecognize(true);
        segment.enablePlaceRecognize(true);
        for (String sentence : testCase)
        {
            List<Term> termList = segment.seg(sentence);
            System.out.println(termList);
        }


    }
}
